Millions of Americans undergo surgery every year, and postoperative pain is common and too often poorly managed. Poorly managed postoperative pain may cause severe functional impairment, adverse events, impaired care of the underlying diseases, transition to chronic pain, and decreased quality of life. Many controlled studies have demonstrated a variety of interventions that benefit postoperative pain, yet their application in a large and more diverse population is unknown, and a nationally endorsed, concise quality process metric for postoperative pain management does not exist. One roadblock is that postoperative pain and its related outcomes are complex. The gathering of evidence from electronic health data, which draw from and inform real-world practice, could bypass this roadblock and inform decisions leading to more effective and efficient postoperative pain management. This project seeks to measure quality of various care processes for postoperative pain, assess proposed evidence-based interventions from randomized controlled trials, lay the ground work for systematic pain-related research using EMRs, and produce population-based evidence for a nationally-endorsed postoperative pain management quality metric. To achieve these objectives, this project has three specific aims: (1) to develop standardized electronic definitions of pain-related care processes and outcomes (e.g. prolonged opioid use, readmission for pain, etc.); (2) to extract clinically meaningful data from both structured data and free text in electronic medical records (EMR) and examine the relationship between recommended care processes and outcomes for postoperative pain using EMRs; (3) to validate pain-related process-outcome relationships at a national level and to develop a National Quality Forum submission and evaluation form for a postoperative pain quality metric(s). This project will achieve these aims by developing data capture algorithms on Palo Alto Veterans Administration (VA) Healthcare data, refining algorithms at a tertiary academic hospital, and validating algorithms on the National VA healthcare system. Data will be identified and extracted from the EMR using an extended version of our validated data-mining workflow. Our established experience with quality metric development and NQF endorsement will facilitate the dissemination of this work. These approaches are the basis of a learning healthcare system, and the proposed research directly aligns with AHRQ's mission and goals to improve healthcare quality through health information technology and data resources.